package com.bootdo.core.domain;

public enum GameType {

    CN_FAST_CHESS("CN_FAST_CHESS","1","中国象棋快棋"),
    CN_SLOW_CHESS("CN_SLOW_CHESS","2","中国象棋慢棋"),
    INTL_FAST_CHESS("INTL_FAST_CHESS","3","国际象棋快棋"),
    INTL_SLOW_CHESS("INTL_SLOW_CHESS","4","国际象棋慢棋");

    private String name;

    private String value;

    private String desc;

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    GameType(String name, String value, String desc) {
        this.name = name;
        this.value = value;
        this.desc = desc;
    }

    public static GameType getByValue(String value) {
        for (GameType gameType : GameType.values()) {
            if (gameType.getValue().equalsIgnoreCase(value)) {
                return gameType;
            }
        }
        return null;
    }
}
